{include file="header"}
<div class="layui-fluid">
    <div class="layui-card">
      <div class="layui-card-body" style="padding: 15px;">
	      <!--表单提交-->
        {if get('id',0) == '0'}
        <form class="layui-form" url="{:url('admin/api/add')}" t_url="javascript:parent.location.reload();">
        {else /}
        <form class="layui-form" url="{:url('admin/api/edit')}" t_url="javascript:parent.location.reload();">
        <input type="hidden" name="id" value="{$c.id}">
        {/if}
        <input type="hidden" name="model" value="dan">
          <div class="layui-form-item">
            <label class="layui-form-label">标题</label>
            <div class="layui-input-block">
              <input type="text" name="title" lay-verify="required" value="{$c.title}"  autocomplete="off" placeholder="请输入" class="layui-input">
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">别名</label>
            <div class="layui-input-inline">
              <input type="text" name="alias" lay-verify="required" value="{$c.alias}" autocomplete="off" placeholder="请输入" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">自定义访问路径名称</div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">定义模板</label>
            <div class="layui-input-inline">
              <input type="text" name="muban" lay-verify="required" value="{$c.muban|default="dan"}" autocomplete="off" placeholder="请输入" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">默认现有模板dan.html 例如你填写115cms就需要在/app/template/{:muban()}/index/目录下新建115cms.html自由布局</div>
          </div>
		  <div class="layui-form-item">
            <label class="layui-form-label">显示</label>
              <div class="layui-input-inline">
                <input type="radio" name="open" value="1" title="是" {if $c.open==1}checked=""{/if}>
				        <input type="radio" name="open" value="0" title="否" {if $c.open==0}checked=""{/if}>
              </div>
          </div>
          <iframe style="display:none;" id="iframe" src="{:url('admin/api/at',array('m'=>'dan','id'=>$c['id']))}"></iframe>
		  <div class="layui-form-item">
            <label for="L_title" class="layui-form-label">内容</label>
              <div class="layui-input-block">
                {include file="editor"} 
    			  <div style="border : 1px solid #cccccc;border-top: #ffffff;padding: 5px;">
                      <button type="button" id="fujianfgf" class="layui-btn layui-btn-sm layui-btn-danger"><i class="layui-icon">&#xe674;</i>附件分隔符</button>
                      <button type="button" id="scfujian" class="layui-btn layui-btn-sm layui-btn-normal" style="margin-right: 10px;"><i class="layui-icon">&#xe62f;</i>上传附件</button>
                      <button type="button" id="tianjialianjie" class="layui-btn layui-btn-sm layui-btn-normal"><i class="layui-icon">&#xe64c;</i>添加链接</button>
                      {if $c.id}
                      <button type="button" id="chongzhi" class="layui-btn layui-btn-sm layui-btn-normal" url="{:url('admin/api/cz',array('m'=>'dan','id'=>$c.id))}"><i class="layui-icon">&#xe669;</i>重置内容</button>
                      {/if}
                    </div>
              </div>
          </div>
		   
          <div class="layui-form-item layui-layout-admin">
            <div class="layui-input-block">
              <div class="layui-footer" style="left: 0;">
                <button class="layui-btn" lay-submit="" lay-filter="cms">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
              </div>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
  {include file="footer"}